using System.Collections.Generic;

namespace JGSY.CMS.LowCode.Platform.Application.DTOs
{
    /// <summary>
    /// 批量删除请求DTO
    /// </summary>
    public class BatchDeleteRequest
    {
        public List<string> FileIds { get; set; } = new();
        public List<long> Ids { get; set; } = new();
        public bool DeleteChildren { get; set; } = false;
    }

    /// <summary>
    /// 批量删除结果DTO
    /// </summary>
    public class BatchDeleteResult
    {
        /// <summary>
        /// 是否成功
        /// </summary>
        public bool Success { get; set; }

        /// <summary>
        /// 成功删除的数量
        /// </summary>
        public int SuccessCount { get; set; }

        /// <summary>
        /// 失败的数量
        /// </summary>
        public int FailureCount { get; set; }

        /// <summary>
        /// 错误的数量 (兼容属性)
        /// </summary>
        public int ErrorCount 
        { 
            get => FailureCount; 
            set => FailureCount = value; 
        }

        /// <summary>
        /// 失败的项目
        /// </summary>
        public List<string> FailedItems { get; set; } = new();

        /// <summary>
        /// 错误列表 (兼容属性)
        /// </summary>
        public List<string> Errors 
        { 
            get => FailedItems; 
            set => FailedItems = value; 
        }

        /// <summary>
        /// 错误消息
        /// </summary>
        public string? ErrorMessage { get; set; }
    }

    /// <summary>
    /// 分页结果DTO (别名兼容)
    /// </summary>
    /// <typeparam name="T">数据类型</typeparam>
    public class PagedResult<T> : PagedResultDto<T>
    {
        /// <summary>
        /// 页码 (兼容属性)
        /// </summary>
        public int PageNumber 
        { 
            get => PageIndex; 
            set => PageIndex = value; 
        }

        public PagedResult() : base() { }
        
        public PagedResult(IEnumerable<T> items, int totalCount, int pageIndex, int pageSize)
            : base(items, totalCount, pageIndex, pageSize)
        {
        }
    }
}
